-
Notifications
You must be signed in to change notification settings - Fork 513
refactor: Chunk.modules
=> Chunk.mapModules
(webpack v3.0.0
)
#543
Conversation
fix: add missing `options.ignoreOrder` details in Error message (webpack-contrib#539)
Feature/webpack3
@@ -269,7 +269,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) { | |||
async.forEach(chunks, function(chunk, callback) { | |||
var extractedChunk = extractedChunks[chunks.indexOf(chunk)]; | |||
var shouldExtract = !!(options.allChunks || isInitialOrHasNoParents(chunk)); | |||
async.forEach(chunk.modules.slice(), function(module, callback) { | |||
async.forEach(chunk.mapModules(function(c) { return c; }), function(module, callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having just refactored this entire plugin, there are 4/5 instances of chunk.modules.something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about function (m) { return m; }
for precise initials?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c === chunk
the naming convention is as it should be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapModules
map functions on each module so the iteratee will be called with each module. See https://github.com/webpack/webpack/pull/4764/files#diff-8941681d920ac4feda44f522b986c2d0R115
This will land in the |
@michael-ciniawsky - This change is not backwards compatible with 2.x hence why it's targeting the This can merge into that target branch when ready & I can rebase in the changes to the defaults PR. |
@d3viant0ne I'll change all of the instances accordingly. Sound good? |
Chunk.modules
=> Chunk.mapModules
(webpack v3.0.0
)
@MirrorBytes What is missing here, did you find the remaining places, where this needs to be updated as @d3viant0ne suggested? |
Chunk.modules
=> Chunk.mapModules
(webpack v3.0.0
)Chunk.modules
=> Chunk.mapModules
(webpack v3.0.0
)
@michael-ciniawsky maybe we can check webpack version and use difference behavior without breaking changes? |
@evilebottnawi How would this look like ? There is function mapModules (chunk) {
if (this.version >= 3) return chunk.mapModule((c) => c)
return chunk.modules.slice()
} or check the |
@michael-ciniawsky seems good, but need wait what says @d3viant0ne |
Fixes #494 |
Chunk.modules
=> Chunk.mapModules
(webpack v3.0.0
)Chunk.modules
=> Chunk.mapModules
(webpack v3.0.0
)
@MirrorBytes - This will need to be rebased now that the defaults PR has landed. Don't know how good you are with git, if you aren't comfortable doing it just give me write permission ( hit edit in this pr & you should see a check box ) and I will rebase it for you. |
I hear appveyor has some issues lately. perhaps someone else can run it on windows to release it. |
I rebased this PR on With the additional changes, the test does not output any warnings like it did before:
I ran the tests on Windows 10, node v6.4.0, webpack 3.0.0.
Note though that this seems unrelated to this PR as the test also fails on |
I'll try to take a look at the windows issue tonight. |
any status? |
Not sure if this is related but I recently started encountering the following issue on Windows 10.
|
This has been taken care of in another PR given the time pressure to get etwp stable in Webpack 3.x |
- refactor: Pass a unique compiler name to get child compilation [483](#483) - refactor: Apply webpack-defaults [542](#542) BREAKING CHANGE: Enforces `engines` of `"node": ">=4.3.0 < 5.0.0 || >= 5.10` - refactor: DeprecationWarning: Chunk.modules [543](#543) BREAKING CHANGE: Updates to `Chunk.mapModules`. This release is not backwards compatible with `Webpack 2.x` due to breaking changes in webpack/webpack#4764 - fix: css generation order issue see: webpack/webpack#5225 BREAKING CHANGE: Enforces `peerDependencies` of `"webpack": "^3.1.0"`.
Refactors to use webpack 3.x
Chunk.mapModules
Closes #529